package net.aiion.weave.impl.xml.events;

import net.aiion.weave.spi.xml.events.ProcessingInstructionXmlEvent;

public class ProcessingInstructionXmlEventImpl extends XmlEventImpl implements ProcessingInstructionXmlEvent
{
    private final String target;
    private final String data;

    public ProcessingInstructionXmlEventImpl(final String aTarget, final String aData) {
        target = aTarget;
        data = aData;
    }

    @Override
    public int getType() {
        return PROCESSING_INSTRUCTION;
    }

    @Override
    public String getTarget() {
        return target;
    }

    @Override
    public String getData() {
        return data;
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        builder.append("XmlProcessingInstructionImpl[target=");
        builder.append(target);
        builder.append(", data=");
        builder.append(data);
        builder.append("]");
        return builder.toString();
    }
}
